cmake_minimum_required(VERSION 3.30)
# 设置项目名称
project(libevent_tcp_listener)
#set(CMAKE_TOOLCHAIN_FILE "/Users/lucifer/work-source/vcpkg/scripts/buildsystems/vcpkg.cmake")
#set(CMAKE_C_STANDARD 11)
set(CMAKE_CXX_STANDARD 11)  # 或者更高版本，如 14、17、20
set(CMAKE_CXX_STANDARD_REQUIRED ON)
# 查找 libevent 库
find_package(libevent REQUIRED)
# 查找 librdkafka 包
find_package(RdKafka CONFIG REQUIRED)

add_executable(libevent_tcp_listener main.cpp
        sockets/dv_qkd_tcp_server.h
        sockets/dv_qkd_tcp_server.cpp
        sockets/qkd_session.cpp
        sockets/qkd_session.h)
# 链接 libevent 库
target_link_libraries(libevent_tcp_listener PRIVATE libevent::core libevent::extra RdKafka::rdkafka RdKafka::rdkafka++)

